home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / acp3.00 / sercon.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-18  |  1.3 KB  |  64 lines

  1. #include <exec/types.h>
  2. #include <exec/exec.h>
  3. #include <exec/memory.h>
  4. #include <exec/ports.h>
  5. #include <libraries/dos.h>
  6. #include <devices/timer.h>
  7. #include <intuition/intuitionbase.h>
  8. #include "work:romconf/doorheader.h"
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <clib/exec_protos.h>
  12. extern void getuserstring();
  13. int Register(int node);
  14. VOID ShutDown(VOID);
  15. BOOL PutToPort(struct Message *);
  16. struct MsgPort *Nport;
  17. struct MsgPort *replymp;
  18.  
  19. extern long MasterSig;
  20. extern long signals;
  21. char NPortName[80];
  22. char MasterPort[80];
  23. long sersig;
  24. int Register(int node)
  25. {
  26. sprintf(MasterPort,"AEServer.%d",node);
  27.  Nport=(struct MsgPort *)FindPort(MasterPort);
  28.   if(!Nport)
  29.   {
  30.     ShutDown(); return(0);
  31.   }
  32.   return(1);
  33. }
  34.  
  35. VOID ShutDown(VOID)
  36. {
  37. //  DeletePort((struct MsgPort *)replymp);
  38. //  FreeMem(Jhmsg,sizeof(struct JHMessage));
  39. }
  40.  
  41.  
  42.  
  43. BOOL PutToPort(struct Message *message)
  44. {
  45.   PutMsg(Nport,message);
  46.   return((BOOL)1);
  47. }
  48.  
  49. void getuserstring(char *ostring,int nl)
  50. {
  51.   struct JHMessage *Jhmsg;
  52.   Jhmsg=(struct JHMessage *)AllocMem(sizeof(struct JHMessage),MEMF_PUBLIC);
  53.   Jhmsg->Msg.mn_Node.ln_Type=NT_FREEMSG;
  54.   Jhmsg->Msg.mn_Length=sizeof(struct JHMessage);
  55.   Jhmsg->Msg.mn_ReplyPort=0L;
  56.  
  57.         Jhmsg->Command = nl;
  58.         Jhmsg->Data=READIT;
  59.      
  60.     PutToPort((struct Message *)Jhmsg);
  61.  
  62. }
  63.  
  64.